package com.hailian.fintech.hlupmsserver.web;


import com.hailian.fintech.hlcomm_interfaceserver.result.ResultInfo;
import com.hailian.fintech.hlupmsserver.entity.Menu;
import com.hailian.fintech.hlupmsserver.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.List;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wk
 * @since 2020-05-26
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private IMenuService iMenuService;

    @RequestMapping("selectMenuByUserNmae")
    public  Object selectMenuByUserNmae(Principal member){
        List<Menu> menuList = iMenuService.selectMenuByUserNmae(member.getName());
        return new ResultInfo().success(menuList);
    }
}

